home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form FindValue
- BorderStyle = 1 'Fixed Single
- Caption = "Find Value"
- ClientHeight = 3525
- ClientLeft = 2430
- ClientTop = 1590
- ClientWidth = 4995
- ClipControls = 0 'False
- Height = 3990
- Left = 2340
- LinkTopic = "Form1"
- ScaleHeight = 3525
- ScaleWidth = 4995
- Top = 1215
- Width = 5175
- Begin VB.CheckBox ChkWhole
- Caption = "Match to Whole Value Only"
- Height = 255
- Left = 1320
- TabIndex = 10
- Top = 1560
- Width = 2295
- End
- Begin VB.Frame Frame3
- Caption = "Data to Search For"
- Height = 735
- Left = 120
- TabIndex = 7
- Top = 600
- Width = 4695
- Begin VB.TextBox DataView
- BackColor = &H00C0C0C0&
- Enabled = 0 'False
- Height = 315
- Left = 120
- TabIndex = 9
- Top = 270
- Width = 3015
- End
- Begin VB.CommandButton ButtonChange
- Caption = "Change Data"
- Height = 375
- Left = 3240
- TabIndex = 8
- Top = 240
- Width = 1335
- End
- End
- Begin VB.CommandButton ButtonCancel
- Caption = "Close"
- Height = 375
- Left = 2280
- TabIndex = 6
- Top = 3000
- Width = 1215
- End
- Begin VB.CommandButton ButtonStart
- Caption = "Find"
- Height = 375
- Left = 3600
- TabIndex = 5
- Top = 3000
- Width = 1215
- End
- Begin VB.Frame Frame2
- Caption = "Search Area"
- ClipControls = 0 'False
- Height = 615
- Left = 120
- TabIndex = 2
- Top = 2040
- Width = 4695
- Begin VB.OptionButton OptCurrent
- Caption = "Start Search at Current Key"
- Height = 255
- Left = 2280
- TabIndex = 4
- Top = 240
- Value = -1 'True
- Width = 2295
- End
- Begin VB.OptionButton OptRoot
- Caption = "Start Search at Root"
- Height = 255
- Left = 240
- TabIndex = 3
- Top = 240
- Width = 1935
- End
- End
- Begin VB.ComboBox ComboType
- Height = 300
- ItemData = "FINDVALU.frx":0000
- Left = 1440
- List = "FINDVALU.frx":0016
- Style = 2 'Dropdown List
- TabIndex = 0
- Top = 120
- Width = 3495
- End
- Begin VB.Label Label2
- BackStyle = 0 'Transparent
- Caption = "Data Type:"
- Height = 255
- Left = 120
- TabIndex = 1
- Top = 120
- Width = 1215
- End
- Attribute VB_Name = "FindValue"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim Data As Variant
- Dim DataType As Long
- Dim DataSize As Long
- ' Close Button. Unloads the dialog box.
- Private Sub ButtonCancel_Click()
- Unload FindValue
- End Sub
- ' Change Data Button. This brings up a dialog box
- ' that allows the user to edit what data to look
- ' for.
- Private Sub ButtonChange_Click()
- Const MaxBytes = 12
- Dim i As Integer
- Dim ending As Integer
- Dim ltr As String
- Select Case ComboType.ListIndex
- Case 0
- DataType = Reg_SZ
- #If Win32 Then
- Case 1
- DataType = Reg_Expand_SZ
- Case 2
- DataType = Reg_Multi_SZ
- Case 3
- DataType = Reg_Dword
- Case 4
- DataType = Reg_Dword_Big_Endian
- Case 5
- DataType = Reg_Binary
- #End If
- End Select
-
- GlobalValueName = ""
- GlobalValueVariant = Data
- GlobalValueSize = Len(Data)
- GlobalValueType = DataType
- GlobalValueChanged = False
- Select Case GlobalValueType
- Case Reg_None
- Load StringEdit
- StringEdit.Show vbModal
- Case Reg_SZ
- Load StringEdit
- StringEdit.Show vbModal
- End Select
- If GlobalValueChanged = False Then
- Exit Sub
- End If
- Data = GlobalValueVariant
- DataSize = GlobalValueSize
- DataView.Text = ""
- ' This trims binary/string data to the size of the
- ' edit box.
- If (DataSize > MaxBytes) Then ending = MaxBytes Else ending = DataSize
- For i = 1 To ending
- ltr = Mid(Data, i, 1)
- DataView.Text = DataView.Text & ltr
- Next i
- If (ending = MaxBytes) Then
- DataView.Text = DataView.Text & "..."
- End If
- End Sub
- ' Find Button. This finds all the keys and values
- ' that match, and puts them into another form.
- Private Sub ButtonStart_Click()
- Dim whole As Boolean
- Dim AtRoot As Boolean
- Dim RetVal As Boolean
- whole = ChkWhole.Value
- AtRoot = OptRoot.Value
- FindValue.MousePointer = 11
- RetVal = BaseForm.Registry1.FindFirstValue(Data, DataType, DataSize, whole, AtRoot)
- If RetVal = False Then
- MsgBox ("There are no values in this area that match.")
- FindValue.MousePointer = 0
- Exit Sub
- End If
- FindValue.MousePointer = 0
- FindResults.listresults.Clear
- Do
- FindResults.listresults.AddItem "KEY: " & BaseForm.Registry1.FindResultKey
- #If Win32 Then
- FindResults.listresults.AddItem "VALUE NAME: " & BaseForm.Registry1.FindResultValueName
- FindResults.listresults.AddItem ""
- #End If
- Loop While BaseForm.Registry1.FindNextValue() = True
- FindResults.Show
- Exit Sub
- End Sub
- Private Sub ComboType_Change()
- Data = Empty
- DataSize = 0
- End Sub
- ' Make sure the (preloaded) combobox that shows the
- ' type of data to look for shows the first element
- ' in the list.
- Private Sub Form_Load()
- ComboType.ListIndex = 0
- ' In this key, there is only one choice. (REG_SZ)
- ComboType.Enabled = False
- DataView.Text = Data
- End Sub
-